package com.lkd.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lkd.domain.Sku;
import com.lkd.mapper.SkuMapper;
import com.lkd.pageParam.SkuPageParam;
import com.lkd.service.ISkuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 商品表 服务实现类
 * </p>
 *
 * @author author
 * @since 2025-02-08
 */
@Service
public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements ISkuService {

    @Override
    public Page<Sku> getPage(SkuPageParam param) {
        //准备分页条件
        Page<Sku> page = new Page<>();
        page.setSize(param.getPageSize()).setPages(param.getPageIndex());
        //准备查询条件
        LambdaQueryWrapper<Sku> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Sku::getSkuName,param.getSkuName());
        return  page(page,wrapper);
    }
}
